#include "HowToPlayState.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "Game.h"
#include "MainMenuState.h"
#include "BitmapFont.h"
#include <string>
using std::string;
#include <algorithm>
#include "GamePlayState.h"
#include "CreditsState.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "MenuManager.h"


CHowToPlayState* CHowToPlayState::GetInstance(void)
{
	static CHowToPlayState s_Instance;
	return &s_Instance;
}

CHowToPlayState::CHowToPlayState(void)
{
	m_pD3D = nullptr;
	m_pDI  = nullptr;
	m_pBF = nullptr;
}

CHowToPlayState::~CHowToPlayState(void)
{
}

void CHowToPlayState::Enter( void )
{
	m_pD3D = CSGD_Direct3D::GetInstance();
	m_pDI  = CSGD_DirectInput::GetInstance();
	m_pBF = new CBitmapFont;
	m_pBF->Initialize();
}
void CHowToPlayState::Exit( void )
{
	delete m_pBF;

}
bool CHowToPlayState::Input(void)
{
	if( m_pDI->KeyPressed( DIK_ESCAPE ))
	{
		CMenuManager::GetInstance()->GoBack();
		CGame::GetInstance()->ChangeState( CMenuManager::GetInstance()->PlayBack() );
		//return false;
	}
	return true;
}
void CHowToPlayState::Update(float fElapsedTime)
{

}
void CHowToPlayState::Render(void)
{
	string word;
		word = "DODGE BALL RULES:";
	m_pBF->Print(word.c_str(), 00, 00, 1);
		word = "HOW TO WIN:";
	m_pBF->Print(word.c_str(), 70, 40, 0.75);
		word = "WHEN ALL OF ONE TEAMS PLAYERS";
	m_pBF->Print(word.c_str(), 100, 70, 0.4);
		word = "GET OUT THE OTHER TEAM WINS";
	m_pBF->Print(word.c_str(), 100, 87, 0.4);
		word = "CONTROLS:";
	m_pBF->Print(word.c_str(), 70, 115, 0.75);
		word = "PLAYER MOVEMENT CONTROLLED BY ARROWS";
	m_pBF->Print(word.c_str(), 100, 150, 0.4);
		word = "PRESSING D WILL EITHER THROW OR CATCH";
	m_pBF->Print(word.c_str(), 100, 167, 0.4);
		word = "ADVANCED TIPS:";
	m_pBF->Print(word.c_str(), 70, 215, 0.75);
		word = "IF A PLAYER IS HIT WITH A BALL THEY ARE OUT";
	m_pBF->Print(word.c_str(), 100, 250, 0.4);
		word = "BUT IF ITS CAUGHT THE THROWING PLAYER IS OUT";
	m_pBF->Print(word.c_str(), 100, 267, 0.4);
		word = "PLAYER MOVEMENT CONTROLLED BY ARROWS";
	m_pBF->Print(word.c_str(), 100, 150, 0.4);
		word = "ENEMIES AND PLAYERS LOOK THE SAME";
	m_pBF->Print(word.c_str(), 200, 350, 0.4);
		word = "AND WILL LOOK LIKE THIS";
	m_pBF->Print(word.c_str(), 200, 370, 0.4);

}